﻿@page "/sdk/objects/application/c/{PageName?}"

@model WebVella.Erp.Plugins.SDK.Pages.Application.CreateModel
@using WebVella.Erp.Web.Utils;
@{
	Layout = "~/Pages/_AppMaster.cshtml";
	ViewData["Title"] = "Create New Application";

}

<wv-page-header color="#dc3545" area-label="Applications" title="Create New App"
				icon-class="fa fa-plus" return-url="@Model.ReturnUrl">
	<wv-page-header-actions>
		@foreach (var action in Model.HeaderActions)
		{
			@Html.Raw(action)
		}
	</wv-page-header-actions>
</wv-page-header>

<wv-validation errors="@Model.Validation.ToErrorList()" message="@Model.Validation.Message"></wv-validation>

<wv-form id="CreateRecord" name="CreateRecord" validation-errors="Model.Validation.ToErrorList()" label-mode="Stacked" mode="Form">
	<wv-section class="mt-4">
		<wv-row>
			<wv-column span="6">
				<wv-field-text label-text="Name" value="@Model.Name" name="Name" required="true"></wv-field-text>
			</wv-column>
			<wv-column span="6">
				<wv-field-text label-text="Label" value="@Model.Label" name="Label" required="true"></wv-field-text>
			</wv-column>
		</wv-row>
		<wv-row>
			<wv-column span="6">
				<wv-field-text label-text="Icon CSS Class" value="@Model.IconClass" name="IconClass"></wv-field-text>
			</wv-column>
			<wv-column span="6">
				<wv-field-color label-text="Color" value="@Model.Color" name="Color"></wv-field-color>
			</wv-column>
		</wv-row>
		<wv-row>
			<wv-column span="6">
				<wv-field-text label-text="Author" value="@Model.Author" name="Author"></wv-field-text>
			</wv-column>
			<wv-column span="6">
				<wv-field-number label-text="Weight" decimal-digits="0" value="@Model.Weight" name="Weight"></wv-field-number>
			</wv-column>
		</wv-row>
		<wv-row>
			<wv-column>
				<wv-field-textarea label-text="Description" value="@Model.Description" name="Description"></wv-field-textarea>
			</wv-column>
		</wv-row>
		<wv-row>
			<wv-column>
				<wv-field-multiselect label-text="Access" value="@Model.Access" name="Access" options="Model.RoleOptions.ToWvSelectOption()"></wv-field-multiselect>
			</wv-column>
		</wv-row>
	</wv-section>
</wv-form>
